<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"blog.hory-ai.com","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"right","Muse | Mist":320,"display":"always","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":true},"bookmark":{"enable":true,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta property="og:type" content="website">
<meta property="og:title" content="Horysk 宏睿时空">
<meta property="og:url" content="http://blog.hory-ai.com/page/7/index.html">
<meta property="og:site_name" content="Horysk 宏睿时空">
<meta property="og:locale" content="en_US">
<meta property="article:author" content="Hory Skone">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://blog.hory-ai.com/page/7/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : true,
    isPost : false,
    lang   : 'en'
  };
</script>

  <title>Horysk 宏睿时空</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Horysk 宏睿时空</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>Tags</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>Categories</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>Search
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="Searching..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <a href="https://github.com/horysk" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content index posts-expand">
            



	<div class="tag-cloud">
	  <div class="tag-cloud-tags" id="tags">
		<a href="/tags/AI/" style="font-size: 16px; color: #fff">AI</a> <a href="/tags/BI/" style="font-size: 16px; color: #fff">BI</a> <a href="/tags/Centos/" style="font-size: 16px; color: #fff">Centos</a> <a href="/tags/DNS/" style="font-size: 16px; color: #fff">DNS</a> <a href="/tags/Dapp/" style="font-size: 16px; color: #fff">Dapp</a> <a href="/tags/Docker/" style="font-size: 16px; color: #fff">Docker</a> <a href="/tags/Hack/" style="font-size: 16px; color: #fff">Hack</a> <a href="/tags/Hexo/" style="font-size: 16px; color: #fff">Hexo</a> <a href="/tags/HyperLedger-Fabric/" style="font-size: 16px; color: #fff">HyperLedger Fabric</a> <a href="/tags/Hyperledger-Fabric/" style="font-size: 16px; color: #fff">Hyperledger Fabric</a> <a href="/tags/Iftop/" style="font-size: 16px; color: #fff">Iftop</a> <a href="/tags/Linux/" style="font-size: 16px; color: #fff">Linux</a> <a href="/tags/ML/" style="font-size: 16px; color: #fff">ML</a> <a href="/tags/MTProxy/" style="font-size: 16px; color: #fff">MTProxy</a> <a href="/tags/Mongo/" style="font-size: 16px; color: #fff">Mongo</a> <a href="/tags/Network/" style="font-size: 16px; color: #fff">Network</a> <a href="/tags/Pyppeteer/" style="font-size: 16px; color: #fff">Pyppeteer</a> <a href="/tags/Tools/" style="font-size: 16px; color: #fff">Tools</a> <a href="/tags/VPN/" style="font-size: 16px; color: #fff">VPN</a> <a href="/tags/Vnc/" style="font-size: 16px; color: #fff">Vnc</a> <a href="/tags/baostock/" style="font-size: 16px; color: #fff">baostock</a> <a href="/tags/block-chain/" style="font-size: 16px; color: #fff">block chain</a> <a href="/tags/centos-xfce-vnc/" style="font-size: 16px; color: #fff">centos-xfce-vnc</a> <a href="/tags/docker/" style="font-size: 16px; color: #fff">docker</a> <a href="/tags/fabric/" style="font-size: 16px; color: #fff">fabric</a> <a href="/tags/hexo/" style="font-size: 16px; color: #fff">hexo</a> <a href="/tags/horysk/" style="font-size: 16px; color: #fff">horysk</a> <a href="/tags/k8s/" style="font-size: 16px; color: #fff">k8s</a> <a href="/tags/linux/" style="font-size: 16px; color: #fff">linux</a> <a href="/tags/mongo/" style="font-size: 16px; color: #fff">mongo</a> <a href="/tags/pyppeteer/" style="font-size: 16px; color: #fff">pyppeteer</a> <a href="/tags/python/" style="font-size: 16px; color: #fff">python</a> <a href="/tags/quant/" style="font-size: 16px; color: #fff">quant</a> <a href="/tags/stock/" style="font-size: 16px; color: #fff">stock</a> <a href="/tags/tushare/" style="font-size: 16px; color: #fff">tushare</a>
	  </div>
	</div>

	
	<script type="text/javascript">
     var alltags = document.getElementsByClassName('tag-cloud-tags');
     var tags = alltags[0].getElementsByTagName('a');
     for (var i = tags.length - 1; i >= 0; i--) {
       var r=Math.floor(Math.random()*75+130);
       var g=Math.floor(Math.random()*75+100);
       var b=Math.floor(Math.random()*75+80);
       tags[i].style.background = "rgb("+r+","+g+","+b+")";
     }
</script>

<style>
  .tag-cloud-tags{
    /*font-family: Helvetica, Tahoma, Arial;*/
    /*font-weight: 100;*/
    text-align: center;
    counter-reset: tags;
  }
  .tag-cloud-tags a{
    border-radius: 6px;
    padding-right: 5px;
    padding-left: 5px;
    margin: 8px 5px 0px 0px;
  }
  .tag-cloud-tags a:before{
    content: "?";
  }

  .tag-cloud-tags a:hover{
     box-shadow: 0px 5px 15px 0px rgba(0,0,0,.4);
     transform: scale(1.1);
     /*box-shadow: 10px 10px 15px 2px rgba(0,0,0,.12), 0 0 6px 0 rgba(104, 104, 105, 0.1);*/
     transition-duration: 0.15s;
  }
</style>

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2016/05/25/Kubernetes%E4%B9%8Bkubectl%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2016/05/25/Kubernetes%E4%B9%8Bkubectl%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97/" class="post-title-link" itemprop="url">Kubernetes之kubectl常用命令使用指南</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2016-05-25 14:17:10" itemprop="dateCreated datePublished" datetime="2016-05-25T14:17:10+00:00">2016-05-25</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/k8s/" itemprop="url" rel="index"><span itemprop="name">k8s</span></a>
                </span>
                  , 
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/k8s/docker/" itemprop="url" rel="index"><span itemprop="name">docker</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2016/05/25/Kubernetes%E4%B9%8Bkubectl%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2016/05/25/Kubernetes%E4%B9%8Bkubectl%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>6.2k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>6 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>kubectl是一个用于操作kubernetes集群的命令行接口,通过利用kubectl的各种命令可以实现各种功能,是在使用kubernetes中非常常用的工具。这里我们会通过一些简单的实例来展现其中一些高频命令的使用方法。<br>更为重要的是这些命令使用的场景以及能够解决什么样的问题。这篇文章我们来介绍一下创建和删除相关的命令。</p>
<h2 id="常用命令"><a href="#常用命令" class="headerlink" title="常用命令"></a>常用命令</h2><p>kubectl创建和删除相关，本文将会简单介绍一下如下命令</p>
<p>项番    命令    说明<br>No.1    run    在集群上运行一个镜像<br>No.2    create    使用文件或者标准输入的方式创建一个资源<br>No.3    delete    使用文件或者标准输入以及资源名称或者标签选择器来删除某个资源<br>事前准备</p>
<h2 id="版本"><a href="#版本" class="headerlink" title="版本"></a>版本</h2><p>[root@ku8-1 tmp]# kubectl version<br>Client Version: version.Info{Major:”1”, Minor:”5”, GitVersion:”v1.5.2”, GitCommit:”08e099554f3c31f6e6f07b448ab3ed78d0520507”, GitTreeState:”clean”, BuildDate:”2017-01-12T04:57:25Z”, GoVersion:”go1.7.4”, Compiler:”gc”, Platform:”linux/amd64”}<br>Server Version: version.Info{Major:”1”, Minor:”5”, GitVersion:”v1.5.2”, GitCommit:”08e099554f3c31f6e6f07b448ab3ed78d0520507”, GitTreeState:”clean”, BuildDate:”2017-01-12T04:52:34Z”, GoVersion:”go1.7.4”, Compiler:”gc”, Platform:”linux/amd64”}</p>
<p>##　集群构成<br>一主三从的Kubernetes集群</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">项番	类型	Hostname	IP</span><br><span class="line">No<span class="number">.1</span>	Master	ku8-<span class="number">1</span>	<span class="number">192.168</span><span class="number">.32</span><span class="number">.131</span></span><br><span class="line">No<span class="number">.1</span>	Node	ku8-<span class="number">2</span>	<span class="number">192.168</span><span class="number">.32</span><span class="number">.132</span></span><br><span class="line">No<span class="number">.1</span>	Node	ku8-<span class="number">3</span>	<span class="number">192.168</span><span class="number">.32</span><span class="number">.133</span></span><br><span class="line">No<span class="number">.1</span>	Node	ku8-<span class="number">4</span>	<span class="number">192.168</span><span class="number">.32</span><span class="number">.134</span></span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get nodes</span></span><br><span class="line">NAME             STATUS    AGE</span><br><span class="line"><span class="number">192.168</span><span class="number">.32</span><span class="number">.132</span>   Ready     12m</span><br><span class="line"><span class="number">192.168</span><span class="number">.32</span><span class="number">.133</span>   Ready     11m</span><br><span class="line"><span class="number">192.168</span><span class="number">.32</span><span class="number">.134</span>   Ready     11m</span><br></pre></td></tr></table></figure>
<p>kubectl run<br>##　运行一个镜像<br>kubectl run和docker run一样，它能将一个镜像运行起来，我们使用kubectl run来将一个sonarqube的镜像启动起来。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl run sonarqube --image=192.168.32.131:5000/sonarqube:5.6.5 --replicas=1 --port=9000</span></span><br><span class="line">deployment <span class="string">&quot;sonarqube&quot;</span> created</span><br></pre></td></tr></table></figure>
<p>让我们来看看这条kubectl run之后，kubernetes做了什么，从它的提示看到创建了一个deployment（1.4之后推荐的方式）。</p>
<h2 id="确认Deployment"><a href="#确认Deployment" class="headerlink" title="确认Deployment"></a>确认Deployment</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get deployment</span></span><br><span class="line">NAME        DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE</span><br><span class="line">sonarqube   <span class="number">1</span>         <span class="number">1</span>         <span class="number">1</span>            <span class="number">1</span>           5m</span><br></pre></td></tr></table></figure>
<p>##　确认pod<br>kubernetes将镜像运行在pod中以方便实施卷和网络共享等管理，使用get pods可以清楚的看到生成了一个pod</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get pods</span></span><br><span class="line">NAME                         READY     STATUS    RESTARTS   AGE</span><br><span class="line">sonarqube-<span class="number">1880671902</span>-s3fdq   <span class="number">1</span>/<span class="number">1</span>       Running   <span class="number">0</span>          6m</span><br></pre></td></tr></table></figure>
<h2 id="kubectl-delete"><a href="#kubectl-delete" class="headerlink" title="kubectl delete"></a>kubectl delete</h2><p>让我们来试着使用kubectl delete删除一下这些创建的对象</p>
<h2 id="删除pod"><a href="#删除pod" class="headerlink" title="删除pod"></a>删除pod</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl delete pods sonarqube-1880671902-s3fdq</span></span><br><span class="line">pod <span class="string">&quot;sonarqube-1880671902-s3fdq&quot;</span> deleted</span><br></pre></td></tr></table></figure>

<h2 id="确认结果"><a href="#确认结果" class="headerlink" title="确认结果"></a>确认结果</h2><p>可以看到刚刚生成的sonarqube-1880671902-s3fdq正在结束(Terminating）,随之一个新的sonarqube-1880671902-n75d2正在创建，这是正是确保replicas为1的动作。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get pods</span></span><br><span class="line">NAME                         READY     STATUS              RESTARTS   AGE</span><br><span class="line">sonarqube-<span class="number">1880671902</span>-n75d2   <span class="number">0</span>/<span class="number">1</span>       ContainerCreating   <span class="number">0</span>          11s</span><br><span class="line">sonarqube-<span class="number">1880671902</span>-s3fdq   <span class="number">0</span>/<span class="number">1</span>       Terminating         <span class="number">0</span>          10m</span><br></pre></td></tr></table></figure>
<h2 id="再次确认"><a href="#再次确认" class="headerlink" title="再次确认"></a>再次确认</h2><p>稍等之后再次确认，发现replicas仍然保持在1个的状态</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get pods</span></span><br><span class="line">NAME                         READY     STATUS    RESTARTS   AGE</span><br><span class="line">sonarqube-<span class="number">1880671902</span>-n75d2   <span class="number">1</span>/<span class="number">1</span>       Running   <span class="number">0</span>          40s</span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get deployments</span></span><br><span class="line">NAME        DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE</span><br><span class="line">sonarqube   <span class="number">1</span>         <span class="number">1</span>         <span class="number">1</span>            <span class="number">1</span>           15m</span><br></pre></td></tr></table></figure>
<h2 id="删除deployment"><a href="#删除deployment" class="headerlink" title="删除deployment"></a>删除deployment</h2><p>直接删除pod触发了replicas的确保机制，那么我们删除deployment</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl delete deployment sonarqube</span></span><br><span class="line">deployment <span class="string">&quot;sonarqube&quot;</span> deleted</span><br></pre></td></tr></table></figure>
<h2 id="结果确认"><a href="#结果确认" class="headerlink" title="结果确认"></a>结果确认</h2><p>通过使用deployment进行删除，则全部删除。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get pods</span></span><br><span class="line">No resources found.</span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get deployments</span></span><br><span class="line">No resources found.</span><br></pre></td></tr></table></figure>
<h2 id="kubectl-create"><a href="#kubectl-create" class="headerlink" title="kubectl create"></a>kubectl create</h2><p>使用kubectl run在设定很复杂的时候需要非常长的一条语句，敲半天也很容易出错，也没法保存，在碰到转义字符的时候也经常会很抓狂，所以更多场景下会使用yaml或者json文件，而使用kubectl create或者delete就可以利用这些yaml文件。<br>比如，我们使用如下的方式来分别创建mysql和sonarqube的RC。</p>
<p>事前准备</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># ls yamls</span></span><br><span class="line">mysql.yaml  sonar.yaml</span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># cat yamls/mysql.yaml </span></span><br><span class="line">---</span><br><span class="line">kind: ReplicationController</span><br><span class="line">apiVersion: v1</span><br><span class="line">metadata:</span><br><span class="line">  name: mysql</span><br><span class="line">spec:</span><br><span class="line">  replicas: <span class="number">1</span></span><br><span class="line">  selector:</span><br><span class="line">    name: mysql</span><br><span class="line">  template:</span><br><span class="line">    metadata:</span><br><span class="line">      labels:</span><br><span class="line">        name: mysql</span><br><span class="line">    spec:</span><br><span class="line">      containers:</span><br><span class="line">      - name: mysql</span><br><span class="line">        image: <span class="number">192.168</span><span class="number">.32</span><span class="number">.131</span>:<span class="number">5000</span>/mysql:<span class="number">5.7</span><span class="number">.16</span></span><br><span class="line">        ports:</span><br><span class="line">        - containerPort: <span class="number">3306</span></span><br><span class="line">          protocol: TCP</span><br><span class="line">        env:</span><br><span class="line">          - name: MYSQL_ROOT_PASSWORD</span><br><span class="line">            value: <span class="string">&quot;hello123&quot;</span></span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># </span></span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># cat yamls/sonar.yaml </span></span><br><span class="line">---</span><br><span class="line">kind: ReplicationController</span><br><span class="line">apiVersion: v1</span><br><span class="line">metadata:</span><br><span class="line">  name: sonarqube</span><br><span class="line">spec:</span><br><span class="line">  replicas: <span class="number">1</span></span><br><span class="line">  selector:</span><br><span class="line">    name: sonarqube</span><br><span class="line">  template:</span><br><span class="line">    metadata:</span><br><span class="line">      labels:</span><br><span class="line">        name: sonarqube</span><br><span class="line">    spec:</span><br><span class="line">      containers:</span><br><span class="line">      - name: sonarqube</span><br><span class="line">        image: <span class="number">192.168</span><span class="number">.32</span><span class="number">.131</span>:<span class="number">5000</span>/sonarqube:<span class="number">5.6</span><span class="number">.5</span></span><br><span class="line">        ports:</span><br><span class="line">        - containerPort: <span class="number">9000</span></span><br><span class="line">          protocol: TCP</span><br></pre></td></tr></table></figure>
<h2 id="创建（MYSQL）"><a href="#创建（MYSQL）" class="headerlink" title="创建（MYSQL）"></a>创建（MYSQL）</h2><p>[root@ku8-1 tmp]# kubectl create -f yamls/mysql.yaml<br>replicationcontroller “mysql” created</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">## 确认（MYSQL）</span><br><span class="line">&#96;&#96;&#96;python</span><br><span class="line">[root@ku8-1 tmp]# kubectl get rc</span><br><span class="line">NAME      DESIRED   CURRENT   READY     AGE</span><br><span class="line">mysql     1         1         1         1m</span><br><span class="line">[root@ku8-1 tmp]# kubectl get pod</span><br><span class="line">NAME          READY     STATUS    RESTARTS   AGE</span><br><span class="line">mysql-nl8sq   1&#x2F;1       Running   0          1m</span><br></pre></td></tr></table></figure>
<h2 id="创建（SONARQUBE）"><a href="#创建（SONARQUBE）" class="headerlink" title="创建（SONARQUBE）"></a>创建（SONARQUBE）</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl create -f yamls/sonar.yaml </span></span><br><span class="line">replicationcontroller <span class="string">&quot;sonarqube&quot;</span> created</span><br></pre></td></tr></table></figure>
<h2 id="确认（SONARQUBE）"><a href="#确认（SONARQUBE）" class="headerlink" title="确认（SONARQUBE）"></a>确认（SONARQUBE）</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get pods</span></span><br><span class="line">NAME              READY     STATUS    RESTARTS   AGE</span><br><span class="line">mysql-nl8sq       <span class="number">1</span>/<span class="number">1</span>       Running   <span class="number">0</span>          2m</span><br><span class="line">sonarqube-p1cnj   <span class="number">1</span>/<span class="number">1</span>       Running   <span class="number">0</span>          46s</span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get rc</span></span><br><span class="line">NAME        DESIRED   CURRENT   READY     AGE</span><br><span class="line">mysql       <span class="number">1</span>         <span class="number">1</span>         <span class="number">1</span>         2m</span><br><span class="line">sonarqube   <span class="number">1</span>         <span class="number">1</span>         <span class="number">1</span>         51s</span><br></pre></td></tr></table></figure>
<h2 id="删除（SONARQUBE）"><a href="#删除（SONARQUBE）" class="headerlink" title="删除（SONARQUBE）"></a>删除（SONARQUBE）</h2><p>使用yaml文件也可以直接删除所创建出来的内容，比如我们先删除刚刚创建的sonarqube相关。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl delete -f yamls/sonar.yaml </span></span><br><span class="line">replicationcontroller <span class="string">&quot;sonarqube&quot;</span> deleted</span><br></pre></td></tr></table></figure>
<h2 id="确认（SONARQUBE）-1"><a href="#确认（SONARQUBE）-1" class="headerlink" title="确认（SONARQUBE）"></a>确认（SONARQUBE）</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get pods</span></span><br><span class="line">NAME          READY     STATUS    RESTARTS   AGE</span><br><span class="line">mysql-nl8sq   <span class="number">1</span>/<span class="number">1</span>       Running   <span class="number">0</span>          4m</span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get rc</span></span><br><span class="line">NAME      DESIRED   CURRENT   READY     AGE</span><br><span class="line">mysql     <span class="number">1</span>         <span class="number">1</span>         <span class="number">1</span>         4m</span><br></pre></td></tr></table></figure>
<h2 id="删除（MYSQL）"><a href="#删除（MYSQL）" class="headerlink" title="删除（MYSQL）"></a>删除（MYSQL）</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl delete -f yamls/mysql.yaml </span></span><br><span class="line">replicationcontroller <span class="string">&quot;mysql&quot;</span> deleted</span><br></pre></td></tr></table></figure>
<h2 id="确认（MYSQL）"><a href="#确认（MYSQL）" class="headerlink" title="确认（MYSQL）"></a>确认（MYSQL）</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get pods</span></span><br><span class="line">No resources found.</span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get rc</span></span><br><span class="line">No resources found.</span><br></pre></td></tr></table></figure>
<h2 id="Deployment方式：准备"><a href="#Deployment方式：准备" class="headerlink" title="Deployment方式：准备"></a>Deployment方式：准备</h2><p>RC在1.4之后已经被建议用Deployment方式替换，主要只需要替换kind和apiversion和selector即可,1.5和1.6在此处也略有区别。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># ls yamls/</span></span><br><span class="line">mysql.yaml  sonar.yaml</span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># cat yamls/mysql.yaml </span></span><br><span class="line">---</span><br><span class="line">kind: Deployment</span><br><span class="line">apiVersion: extensions/v1beta1</span><br><span class="line">metadata:</span><br><span class="line">  name: mysql</span><br><span class="line">spec:</span><br><span class="line">  replicas: <span class="number">1</span></span><br><span class="line">  template:</span><br><span class="line">    metadata:</span><br><span class="line">      labels:</span><br><span class="line">        name: mysql</span><br><span class="line">    spec:</span><br><span class="line">      containers:</span><br><span class="line">      - name: mysql</span><br><span class="line">        image: <span class="number">192.168</span><span class="number">.32</span><span class="number">.131</span>:<span class="number">5000</span>/mysql:<span class="number">5.7</span><span class="number">.16</span></span><br><span class="line">        ports:</span><br><span class="line">        - containerPort: <span class="number">3306</span></span><br><span class="line">          protocol: TCP</span><br><span class="line">        env:</span><br><span class="line">          - name: MYSQL_ROOT_PASSWORD</span><br><span class="line">            value: <span class="string">&quot;hello123&quot;</span></span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># </span></span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># cat yamls/sonar.yaml </span></span><br><span class="line">---</span><br><span class="line">kind: Deployment</span><br><span class="line">apiVersion: extensions/v1beta1</span><br><span class="line">metadata:</span><br><span class="line">  name: sonarqube</span><br><span class="line">spec:</span><br><span class="line">  replicas: <span class="number">1</span></span><br><span class="line">  template:</span><br><span class="line">    metadata:</span><br><span class="line">      labels:</span><br><span class="line">        name: sonarqube</span><br><span class="line">    spec:</span><br><span class="line">      containers:</span><br><span class="line">      - name: sonarqube</span><br><span class="line">        image: <span class="number">192.168</span><span class="number">.32</span><span class="number">.131</span>:<span class="number">5000</span>/sonarqube:<span class="number">5.6</span><span class="number">.5</span></span><br><span class="line">        ports:</span><br><span class="line">        - containerPort: <span class="number">9000</span></span><br><span class="line">          protocol: TCP</span><br></pre></td></tr></table></figure>
<h2 id="创建"><a href="#创建" class="headerlink" title="创建"></a>创建</h2><p>有多个yaml文件的时候，可以使用如下方式一下全部创建</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl create -f yamls/</span></span><br><span class="line">deployment <span class="string">&quot;mysql&quot;</span> created</span><br><span class="line">deployment <span class="string">&quot;sonarqube&quot;</span> created</span><br></pre></td></tr></table></figure>
<h2 id="确认"><a href="#确认" class="headerlink" title="确认"></a>确认</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get pods</span></span><br><span class="line">NAME                         READY     STATUS    RESTARTS   AGE</span><br><span class="line">mysql-<span class="number">478535978</span>-2l7kq        <span class="number">1</span>/<span class="number">1</span>       Running   <span class="number">0</span>          3m</span><br><span class="line">sonarqube-<span class="number">3574384362</span>-x3mg2   <span class="number">1</span>/<span class="number">1</span>       Running   <span class="number">0</span>          3m</span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get deployments</span></span><br><span class="line">NAME        DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE</span><br><span class="line">mysql       <span class="number">1</span>         <span class="number">1</span>         <span class="number">1</span>            <span class="number">1</span>           3m</span><br><span class="line">sonarqube   <span class="number">1</span>         <span class="number">1</span>         <span class="number">1</span>            <span class="number">1</span>           3m</span><br></pre></td></tr></table></figure>
<h2 id="删除"><a href="#删除" class="headerlink" title="删除"></a>删除</h2><p>同样，有多个yaml文件的时候，可以使用如下方式一下全部删除</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl delete -f yamls/</span></span><br><span class="line">deployment <span class="string">&quot;mysql&quot;</span> deleted</span><br><span class="line">deployment <span class="string">&quot;sonarqube&quot;</span> deleted</span><br></pre></td></tr></table></figure>
<h2 id="确认-1"><a href="#确认-1" class="headerlink" title="确认"></a>确认</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get pods</span></span><br><span class="line">No resources found.</span><br><span class="line">[root@ku8-<span class="number">1</span> tmp]<span class="comment"># kubectl get deployments</span></span><br><span class="line">No resources found.</span><br></pre></td></tr></table></figure>
<p>总结<br>这篇文章通过几个最简单的命令熟悉了如何使用kubectl对镜像进行创建和删除，在后面我们会进一步介绍一些常用的命令。</p>
<p>更多总结可参看：<br><a target="_blank" rel="noopener" href="https://liumiaocn.blog.csdn.net/article/details/88413428">https://liumiaocn.blog.csdn.net/article/details/88413428</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2016/02/06/k8s%20%E7%A6%BB%E7%BA%BF%E5%AE%89%E8%A3%85%20%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85%E5%85%BC%E5%AE%B9centos8%20&&%20ubutnu20.04/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2016/02/06/k8s%20%E7%A6%BB%E7%BA%BF%E5%AE%89%E8%A3%85%20%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85%E5%85%BC%E5%AE%B9centos8%20&&%20ubutnu20.04/" class="post-title-link" itemprop="url">k8s 离线安装 一键安装兼容centos8 && ubutnu20.04</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2016-02-06 14:17:30" itemprop="dateCreated datePublished" datetime="2016-02-06T14:17:30+00:00">2016-02-06</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/docker/" itemprop="url" rel="index"><span itemprop="name">docker</span></a>
                </span>
                  , 
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/docker/k8s/" itemprop="url" rel="index"><span itemprop="name">k8s</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2016/02/06/k8s%20%E7%A6%BB%E7%BA%BF%E5%AE%89%E8%A3%85%20%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85%E5%85%BC%E5%AE%B9centos8%20&&%20ubutnu20.04/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2016/02/06/k8s%20%E7%A6%BB%E7%BA%BF%E5%AE%89%E8%A3%85%20%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85%E5%85%BC%E5%AE%B9centos8%20&&%20ubutnu20.04/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>1.7k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>2 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>K8S 是一个一键安装K8S高可用集群的软件。它可以帮助企业一键搭建完私有云系统，帮助用户在多家云服务商里灵活切换，不再被任何服务商绑架！ 对! 所有的操作只需要一键！</p>
<p>有问题 咨询wechat: horysk</p>
<h1 id="kubernetes-v1-18-2-版本-已经支持-所有监控为最新版本"><a href="#kubernetes-v1-18-2-版本-已经支持-所有监控为最新版本" class="headerlink" title="kubernetes v1.18.2 版本 已经支持, 所有监控为最新版本."></a>kubernetes v1.18.2 版本 已经支持, 所有监控为最新版本.</h1><p>安装很简单， 一键安装，安装一个系统只需要 3 分钟, 安装好以后完整的监控也一并装好，可以直接使用。（不止支持单master 还支持3master 高可用方案)</p>
<h1 id="同时安装三台-方案"><a href="#同时安装三台-方案" class="headerlink" title="同时安装三台 方案:"></a>同时安装三台 方案:</h1><p>记住服务版本 linux AMD64的安装包才是我们支持的。</p>
<p>好现在开始安装，高可用系统 需要3台服务器，我们这里假设3台主机，ip 分别是10.0.0.4, 10.0.0.5,10.0.0.6</p>
<h2 id="好我们需要做下面4件事"><a href="#好我们需要做下面4件事" class="headerlink" title="好我们需要做下面4件事"></a>好我们需要做下面4件事</h2><p>把安装包installer, pack.xxx.xxx.bin 文件 以及kubernetes的官方文件复制到每台主机上<br>在其中一台 运行 sudo ./installer -genkey -hostlist=10.0.0.0 运行完毕，会生成一个k8skey.pem文件，将它复制到其他的主机上<br>在每台主机上运行一次 sudo ./installer –prepare<br>在3台主机上同时运行 sudo ./installer -kubernetestarfile kubernetes-server-linux-amd64.tar.gz -masterip=10.0.0.4,10.0.0.5,10.0.0.6<br>参数说明 -kubernetestarfile kubernetes-server-linux-amd64.tar.gz 是指 使用 kubernetes-server-linux-amd64.tar.gz 这个文件作为kubernetes的官方软件。<br>-masterip=10.0.0.4,10.0.0.5,10.0.0.6 是指 我们选择 10.0.0.4 10.0.0.5 10.0.0.6 作为master节点</p>
<p>剩下的？ 等待就可以了。<br>等安装成功后 你用浏览器访问一下 10.0.0.4:10000 看看，一个新的世界给你准备好了。</p>
<p>你需要下载pack.xxx.xxx.bin 文件和installer 文件。</p>
<p>此外 你还需选择一个kubernetes 的官方发行包。你可以在这里找到官方发行包</p>
<h1 id="安装主机-后添加-方案二"><a href="#安装主机-后添加-方案二" class="headerlink" title="安装主机  后添加  方案二:"></a>安装主机  后添加  方案二:</h1><h2 id="2条命令即可"><a href="#2条命令即可" class="headerlink" title="2条命令即可"></a>2条命令即可</h2><p>#创建密钥<br>sudo ./installer –genkey -hostlist=172.20.2.66</p>
<h2 id="提示kernel-不够请升级centos-kernel-参考"><a href="#提示kernel-不够请升级centos-kernel-参考" class="headerlink" title="提示kernel 不够请升级centos kernel  参考"></a>提示kernel 不够请升级centos kernel  参考<a href></a></h2><h2 id="报错-sysctl-cannot-stat-proc-sys-net-netfilter-nf-conntrack-max-No-such-file-or-directory-请参考一下处理方案"><a href="#报错-sysctl-cannot-stat-proc-sys-net-netfilter-nf-conntrack-max-No-such-file-or-directory-请参考一下处理方案" class="headerlink" title="报错 sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_max: No such file or directory  请参考一下处理方案"></a>报错 sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_max: No such file or directory  请参考一下处理方案</h2><p>#创建集群<br>sudo ./installer   -kubernetestarfile kubernetes-server-linux-amd64.tar.gz -masterip 172.20.2.66<br>image</p>
<h1 id="将一个新节点加入这个集群也只需要一个命令"><a href="#将一个新节点加入这个集群也只需要一个命令" class="headerlink" title="将一个新节点加入这个集群也只需要一个命令"></a>将一个新节点加入这个集群也只需要一个命令</h1><p>1条命令即可</p>
<h1 id="将密钥复制到本地"><a href="#将密钥复制到本地" class="headerlink" title="将密钥复制到本地"></a>将密钥复制到本地</h1><p>cp ../k8skey.pem ./</p>
<h1 id="将机器加入集群"><a href="#将机器加入集群" class="headerlink" title="将机器加入集群"></a>将机器加入集群</h1><p>sudo ./installer   -kubernetestarfile kubernetes-server-linux-amd64.tar.gz -masterip 172.20.2.66</p>
<p><a target="_blank" rel="noopener" href="https://github.com/horysk/k8seasy_release_page">github</a><br><a target="_blank" rel="noopener" href="http://dl.k8seasy.com/">link</a></p>
<h2 id="报错-sysctl-cannot-stat-proc-sys-net-netfilter-nf-conntrack-max-No-such-file-or-directory"><a href="#报错-sysctl-cannot-stat-proc-sys-net-netfilter-nf-conntrack-max-No-such-file-or-directory" class="headerlink" title="报错: sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_max: No such file or directory"></a>报错: sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_max: No such file or directory</h2><p>执行如下</p>
<p>lsmod |grep conntrack</p>
<p>如何返回是空，表示没有加载，那执行如下命令加载即可</p>
<p>modprobe ip_conntrack</p>
<p>再重新执行验证</p>
<p>[root@k8s-node-n2 ~]# lsmod |grep conntrack<br>nf_conntrack_ipv4 20480 0<br>nf_defrag_ipv4 16384 1 nf_conntrack_ipv4<br>nf_conntrack 114688 1 nf_conntrack_ipv4</p>
<p>再重新手动刷新使文件生效就没有问题了</p>
<p>sysctl -p /etc/sysctl.d/kubernetes.conf</p>
<p><a target="_blank" rel="noopener" href="https://www.jianshu.com/p/de4ae3812b04">参考</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2015/11/08/centos7%E5%8D%87%E7%BA%A7%E5%86%85%E6%A0%B8%E8%87%B3%E6%9C%80%E6%96%B0/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2015/11/08/centos7%E5%8D%87%E7%BA%A7%E5%86%85%E6%A0%B8%E8%87%B3%E6%9C%80%E6%96%B0/" class="post-title-link" itemprop="url">centos7升级内核至最新</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2015-11-08 14:17:17" itemprop="dateCreated datePublished" datetime="2015-11-08T14:17:17+00:00">2015-11-08</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2015/11/08/centos7%E5%8D%87%E7%BA%A7%E5%86%85%E6%A0%B8%E8%87%B3%E6%9C%80%E6%96%B0/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2015/11/08/centos7%E5%8D%87%E7%BA%A7%E5%86%85%E6%A0%B8%E8%87%B3%E6%9C%80%E6%96%B0/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>3.1k</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>3 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>centos7升级内核至最新</p>
<h2 id="应用背景："><a href="#应用背景：" class="headerlink" title="应用背景："></a>应用背景：</h2><p>最近在接触k8s，其对内核版本要求较高，就连目前使用的centos7.x默认内核版本为3.10.0-xxx，也是刚好满足其最低要求，故借此机会记录一下升级内核的操作步骤。</p>
<p>测试环境：</p>
<p>系统    当前内核版本    小版本升级<br>CentOS 7.6    3.10.0-957    3.10.0-957.5.1</p>
<p>系统    当前内核版本    大版本升级<br>CentOS 7.6    3.10.0-957    4.20.12-1(目前最新)</p>
<p>操作步骤：</p>
<h2 id="小版本升级"><a href="#小版本升级" class="headerlink" title="小版本升级"></a>小版本升级</h2><ol>
<li>查看当前和可升级版本<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># yum list kernel</span></span><br><span class="line">Installed Packages</span><br><span class="line">kernel.x86_64                           <span class="number">3.10</span><span class="number">.0</span>-<span class="number">957.</span>el7                                      @anaconda</span><br><span class="line">Available Packages</span><br><span class="line">kernel.x86_64                           <span class="number">3.10</span><span class="number">.0</span>-<span class="number">957.5</span><span class="number">.1</span>.el7                                  updates  </span><br></pre></td></tr></table></figure></li>
<li>升级<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># yum update kernel -y </span></span><br></pre></td></tr></table></figure></li>
<li>重启并检查<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># reboot 　　</span></span><br><span class="line"></span><br><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># uname -r </span></span><br></pre></td></tr></table></figure>

</li>
</ol>
<h2 id="大版本升级"><a href="#大版本升级" class="headerlink" title="大版本升级"></a>大版本升级</h2><ol>
<li>载入公钥<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org</span></span><br></pre></td></tr></table></figure></li>
<li>升级安装ELRepo<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm</span></span><br></pre></td></tr></table></figure></li>
<li>载入elrepo-kernel元数据<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># yum --disablerepo=\* --enablerepo=elrepo-kernel repolist</span></span><br></pre></td></tr></table></figure></li>
<li>查看可用的rpm包</li>
</ol>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># yum --disablerepo=\* --enablerepo=elrepo-kernel list kernel*</span></span><br><span class="line">Installed Packages</span><br><span class="line">kernel.x86_64                           <span class="number">3.10</span><span class="number">.0</span>-<span class="number">957.</span>el7                           @anaconda    </span><br><span class="line">kernel.x86_64                           <span class="number">3.10</span><span class="number">.0</span>-<span class="number">957.5</span><span class="number">.1</span>.el7                       @updates     </span><br><span class="line">kernel-tools.x86_64                     <span class="number">3.10</span><span class="number">.0</span>-<span class="number">957.</span>el7                           @anaconda    </span><br><span class="line">kernel-tools-libs.x86_64                <span class="number">3.10</span><span class="number">.0</span>-<span class="number">957.</span>el7                           @anaconda    </span><br><span class="line">Available Packages</span><br><span class="line">kernel-lt.x86_64                        <span class="number">4.4</span><span class="number">.176</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-lt-devel.x86_64                  <span class="number">4.4</span><span class="number">.176</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-lt-doc.noarch                    <span class="number">4.4</span><span class="number">.176</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-lt-headers.x86_64                <span class="number">4.4</span><span class="number">.176</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-lt-tools.x86_64                  <span class="number">4.4</span><span class="number">.176</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-lt-tools-libs.x86_64             <span class="number">4.4</span><span class="number">.176</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-lt-tools-libs-devel.x86_64       <span class="number">4.4</span><span class="number">.176</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-ml.x86_64                        <span class="number">4.20</span><span class="number">.12</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel　// 安装目标版本</span><br><span class="line">kernel-ml-devel.x86_64                  <span class="number">4.20</span><span class="number">.12</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-ml-doc.noarch                    <span class="number">4.20</span><span class="number">.12</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-ml-headers.x86_64                <span class="number">4.20</span><span class="number">.12</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-ml-tools.x86_64                  <span class="number">4.20</span><span class="number">.12</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-ml-tools-libs.x86_64             <span class="number">4.20</span><span class="number">.12</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line">kernel-ml-tools-libs-devel.x86_64       <span class="number">4.20</span><span class="number">.12</span>-<span class="number">1.</span>el7.elrepo                     elrepo-kernel</span><br><span class="line"></span><br><span class="line">说明：</span><br><span class="line"></span><br><span class="line">lt  ：long term support，长期支持版本；</span><br><span class="line"></span><br><span class="line">ml：mainline，主线版本；</span><br></pre></td></tr></table></figure>

<ol start="5">
<li>安装最新版本的kernel<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># yum --disablerepo=\* --enablerepo=elrepo-kernel install  kernel-ml.x86_64  -y</span></span><br></pre></td></tr></table></figure></li>
<li>删除旧版本工具包<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># yum remove kernel-tools-libs.x86_64 kernel-tools.x86_64  -y</span></span><br></pre></td></tr></table></figure></li>
<li>安装新版本工具包<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># yum --disablerepo=\* --enablerepo=elrepo-kernel install kernel-ml-tools.x86_64  -y</span></span><br></pre></td></tr></table></figure></li>
<li>查看内核插入顺序<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># awk -F \&#x27; &#x27;$1==&quot;menuentry &quot; &#123;print i++ &quot; : &quot; $2&#125;&#x27; /etc/grub2.cfg</span></span><br><span class="line"><span class="number">0</span> : CentOS Linux (<span class="number">4.20</span><span class="number">.12</span>-<span class="number">1.</span>el7.elrepo.x86_64) <span class="number">7</span> (Core)</span><br><span class="line"><span class="number">1</span> : CentOS Linux (<span class="number">3.10</span><span class="number">.0</span>-<span class="number">957.5</span><span class="number">.1</span>.el7.x86_64) <span class="number">7</span> (Core)</span><br><span class="line"><span class="number">2</span> : CentOS Linux (<span class="number">3.10</span><span class="number">.0</span>-<span class="number">957.</span>el7.x86_64) <span class="number">7</span> (Core)</span><br><span class="line"><span class="number">3</span> : CentOS Linux (<span class="number">0</span>-rescue-ca0f6fb3c5f24478abc0a2e275281d7a) <span class="number">7</span> (Core)</span><br></pre></td></tr></table></figure>
说明：默认新内核是从头插入，默认启动顺序也是从0开始（当前顺序还未生效），或者使用：<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"> View Code</span><br><span class="line">其中文件 /etc/grub2.cfg 和 /boot/grub2/grub.cfg 内容一致。</span><br></pre></td></tr></table></figure></li>
<li>查看当前实际启动顺序<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># grub2-editenv list</span></span><br><span class="line">saved_entry=CentOS Linux (<span class="number">3.10</span><span class="number">.0</span>-<span class="number">957.5</span><span class="number">.1</span>.el7.x86_64) <span class="number">7</span> (Core)</span><br></pre></td></tr></table></figure></li>
<li>设置默认启动<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># grub2-set-default &#x27;CentOS Linux (4.20.12-1.el7.elrepo.x86_64) 7 (Core)&#x27;</span></span><br><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># grub2-editenv list</span></span><br><span class="line">saved_entry=CentOS Linux (<span class="number">4.20</span><span class="number">.12</span>-<span class="number">1.</span>el7.elrepo.x86_64) <span class="number">7</span> (Core)</span><br></pre></td></tr></table></figure>
或者直接设置数值<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># grub2-set-default 0　　// 0代表当前第一行，也就是上面的4.20.12版本那一行内容</span></span><br><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># grub2-editenv list</span></span><br><span class="line">saved_entry=<span class="number">0</span></span><br></pre></td></tr></table></figure></li>
<li>重启并检查<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># reboot </span></span><br><span class="line"></span><br><span class="line">[root@server-<span class="number">1</span> ~]<span class="comment"># uname -r </span></span><br></pre></td></tr></table></figure>

</li>
</ol>
<p><a target="_blank" rel="noopener" href="https://github.com/gjmzj/kubeasz/blob/master/docs/guide/kernel_upgrade.md">参考</a><br><a target="_blank" rel="noopener" href="https://wiki.centos.org/HowTos/Grub2#head-535f476a61e62f24bc150c73f7e0816f85345f46">link</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2015/09/10/%E7%BD%91%E7%BB%9C%E8%B5%84%E6%BA%90/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2015/09/10/%E7%BD%91%E7%BB%9C%E8%B5%84%E6%BA%90/" class="post-title-link" itemprop="url">个人资料-horysk</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2015-09-10 14:17:31" itemprop="dateCreated datePublished" datetime="2015-09-10T14:17:31+00:00">2015-09-10</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/horysk/" itemprop="url" rel="index"><span itemprop="name">horysk</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2015/09/10/%E7%BD%91%E7%BB%9C%E8%B5%84%E6%BA%90/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2015/09/10/%E7%BD%91%E7%BB%9C%E8%B5%84%E6%BA%90/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>394</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>1 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p><a target="_blank" rel="noopener" href="http://www.hory-ai.com/">horysk</a><br><a target="_blank" rel="noopener" href="http://blog.csdn.net/sirobot">hory-csdn</a><br><a target="_blank" rel="noopener" href="https://www.zhihu.com/people/AI_HH">hory-zhihu</a><br><a target="_blank" rel="noopener" href="https://www.kaggle.com/skhory">kaggle</a><br><a target="_blank" rel="noopener" href="https://www.kingname.info/about/">高级数据挖掘工程师-谢乾坤</a><br><a target="_blank" rel="noopener" href="http://www.scutmath.com/ubuntu_vnc.html">清风的技术小屋</a><br><a target="_blank" rel="noopener" href="https://blog.fullstackpentest.com/">python CTF</a><br><a target="_blank" rel="noopener" href="https://www.cnblogs.com/llongst/p/9482038.html">HyperLedger Fabric 1.4 基础环境搭建</a><br><a target="_blank" rel="noopener" href="https://www.dazhuanlan.com/2019/08/21/5d5c524f315e1/">大专栏</a><br><a target="_blank" rel="noopener" href="https://yuehuaxw.com/2019/03/07/Gitlab%E5%AE%9E%E7%8E%B0CI-CD/">广华</a><br><a target="_blank" rel="noopener" href="https://blog.stanley.wang/">k8s</a><br><a target="_blank" rel="noopener" href="https://www.mls-tech.info/docker/k8s-installation-on-ubuntu1804/">utuntu k8s 梅老师</a><br><a target="_blank" rel="noopener" href="https://jimmysong.io/kubernetes-handbook/practice/install-kubernetes-on-ubuntu-server-16.04-with-kubeadm.html">云原生 k8s</a><br><a target="_blank" rel="noopener" href="https://blog.piaoruiqing.com/2019/09/17/kubernetes-1-installation/">centos  k8s</a><br><a target="_blank" rel="noopener" href="https://github.com/KubeOperator">KubeOperator </a><br><a target="_blank" rel="noopener" href="https://kuboard.cn/install/sealos/#%E7%A6%BB%E7%BA%BF%E5%AE%89%E8%A3%85%E5%B7%A5%E5%85%B7%E7%89%B9%E6%80%A7">kuboard  离线</a><br><a target="_blank" rel="noopener" href="https://yeasy.gitbook.io/docker_practice/setup/kubeadm">docker k8s  从入门到实战</a></p>
<h1 id="AI"><a href="#AI" class="headerlink" title="AI"></a>AI</h1><p><a target="_blank" rel="noopener" href="https://danieljyc.github.io/page/2/">ML</a><br><a target="_blank" rel="noopener" href="https://morvanzhou.github.io/">莫烦python</a><br><a target="_blank" rel="noopener" href="https://support.minitab.com/zh-cn/minitab/18/getting-started/graphing-data/">Minitab </a><br><a target="_blank" rel="noopener" href="http://dblab.xmu.edu.cn/blog/1709-2/">python spark</a><br><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/64413000">power BI</a><br><a target="_blank" rel="noopener" href="https://www.quantinfo.com/Source">宽客在线</a></p>
<h1 id="VPN"><a href="#VPN" class="headerlink" title="VPN"></a>VPN</h1><p><a target="_blank" rel="noopener" href="https://www.fanqiangzhe.com/post/free-vpn-guide/">fanqiangzhe</a><br><a target="_blank" rel="noopener" href="https://hide.me/en/promotion/vpnmentor/?free=1&friend=vpnMentor&banner=3622e812&chan=orgfr&data1=eyJwaWQiOiJLRzY3M1RaUUJFVDkwIiwiY2lkIjoiS0c2NzNVMVcyT0NZQiJ9_cor147230774&data2=D202010120213_o">hide.me</a><br><a target="_blank" rel="noopener" href="https://protonvpn.com/?url_id=0&utm_campaign=ww-all-2a-vpn-gro_aff-tune&utm_medium=link&utm_source=aid-1005&utm_content=6">protonvpn</a><br><a target="_blank" rel="noopener" href="https://www.opera.com/features/free-vpn">opera</a><br><a target="_blank" rel="noopener" href="https://www.tunnelbear.com/account/signup">tunnelbear</a><br><a target="_blank" rel="noopener" href="https://www.hotspotshield.com/free-vpn/">hotspotshield</a><br><a target="_blank" rel="noopener" href="https://www.expressvpn.com/?oid=0">expressvpn</a><br><a target="_blank" rel="noopener" href="https://windscribe.com/upgrade">windscribe</a><br><a target="_blank" rel="noopener" href="https://free-vpn.en.softonic.com/">free-vpn</a><br><a target="_blank" rel="noopener" href="https://protonvpn.com/download">protovpn</a><br><a target="_blank" rel="noopener" href="https://akawa.ink/2019/01/11/docker-pptp-vpn-l2tp-ipsec-vpn">Docker 快速部署 PPTP VPN 和 L2TP + IPSEC VPN</a><br><a target="_blank" rel="noopener" href="http://www.yangfan.cc/stock/1570.html">程序化交易量化资源资源</a><br><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/102154074">vnpy源码解析</a><br><a target="_blank" rel="noopener" href="http://www.snailtoday.com/archives/15501">vnpy源码阅读</a></p>
<h1 id="PDF"><a href="#PDF" class="headerlink" title="PDF"></a>PDF</h1><p><a target="_blank" rel="noopener" href="http://so.tushugu.com/">pdf 搜书</a><br><a target="_blank" rel="noopener" href="http://www.xwood.net/_site_domain_/_root/5870/5930/5932/t_c265768.html">集体智慧编程</a><br><a target="_blank" rel="noopener" href="https://wizardforcel.gitbooks.io/python-quant-uqer/content/16.html">python 量化分析师手册</a><br><a target="_blank" rel="noopener" href="https://www.guhai.com.cn/search.html">股海网</a><br><a target="_blank" rel="noopener" href="http://www.7help.net/826.html">金融pdf</a></p>
<h1 id="QUANT"><a href="#QUANT" class="headerlink" title="QUANT"></a>QUANT</h1><p><a target="_blank" rel="noopener" href="http://www.taokmao.com/">交易日记</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2015/08/01/tesks/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2015/08/01/tesks/" class="post-title-link" itemprop="url">tesks</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2015-08-01 14:04:40" itemprop="dateCreated datePublished" datetime="2015-08-01T14:04:40+00:00">2015-08-01</time>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2015/08/01/tesks/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2015/08/01/tesks/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>0</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>1 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2015/08/01/text/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2015/08/01/text/" class="post-title-link" itemprop="url">hello world</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2015-08-01 14:03:50" itemprop="dateCreated datePublished" datetime="2015-08-01T14:03:50+00:00">2015-08-01</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/hexo/" itemprop="url" rel="index"><span itemprop="name">hexo</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2015/08/01/text/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2015/08/01/text/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>838</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>1 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>Welcome to <a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a target="_blank" rel="noopener" href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a target="_blank" rel="noopener" href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/writing.html">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/server.html">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/generating.html">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/one-command-deployment.html">Deployment</a><br>Markown 语法高亮</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">Markdown 目录：</span><br><span class="line">[TOC]</span><br><span class="line"></span><br><span class="line">Markdown 标题：</span><br><span class="line"><span class="comment"># 这是 H1</span></span><br><span class="line"><span class="comment">## 这是 H2</span></span><br><span class="line"><span class="comment">### 这是 H3</span></span><br><span class="line"></span><br><span class="line">Markdown 列表：</span><br><span class="line">- 列表项目</span><br><span class="line"><span class="number">1.</span> 列表项目</span><br><span class="line"></span><br><span class="line">*斜体*或_斜体_</span><br><span class="line">**粗体**</span><br><span class="line">***加粗斜体***</span><br><span class="line">~~删除线~~</span><br><span class="line"></span><br><span class="line">Markdown 插入链接：</span><br><span class="line">[链接文字](链接网址 <span class="string">&quot;标题&quot;</span>)</span><br><span class="line"></span><br><span class="line">Markdown 插入图片：</span><br><span class="line">![alt text](/path/to/img.jpg <span class="string">&quot;Title&quot;</span>)</span><br><span class="line"></span><br><span class="line">Markdown 插入代码块：</span><br><span class="line">    ```python</span><br><span class="line">    <span class="comment">#!/usr/bin/python3</span></span><br><span class="line">    print(<span class="string">&quot;Hello, World!&quot;</span>);</span><br></pre></td></tr></table></figure>

<p>Markdown 引用：</p>
<blockquote>
<p>引用内容</p>
</blockquote>
<h2 id="Markdown-分割线："><a href="#Markdown-分割线：" class="headerlink" title="Markdown 分割线："></a>Markdown 分割线：</h2><p>Markdown 换行：<br><br></p>
<p>Markdown 段首缩进：<br>&ensp; or &#8194; 表示一个半角的空格<br>&emsp; or &#8195;  表示一个全角的空格<br>&emsp;&emsp; 两个全角的空格（用的比较多）<br>&nbsp; or &#160; 不断行的空白格</p>
<pre><code></code></pre>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="http://blog.hory-ai.com/2015/07/01/hello%20world/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Hory Skone">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Horysk 宏睿时空">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2015/07/01/hello%20world/" class="post-title-link" itemprop="url">hello world</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2015-07-01 14:16:33" itemprop="dateCreated datePublished" datetime="2015-07-01T14:16:33+00:00">2015-07-01</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/horysk/" itemprop="url" rel="index"><span itemprop="name">horysk</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine: </span>
    
    <a title="valine" href="/2015/07/01/hello%20world/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2015/07/01/hello%20world/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="Symbols count in article">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">Symbols count in article: </span>
              <span>838</span>
            </span>
            <span class="post-meta-item" title="Reading time">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">Reading time &asymp;</span>
              <span>1 mins.</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>Welcome to <a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a target="_blank" rel="noopener" href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a target="_blank" rel="noopener" href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/writing.html">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/server.html">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/generating.html">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/one-command-deployment.html">Deployment</a><br>Markown 语法高亮</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">Markdown 目录：</span><br><span class="line">[TOC]</span><br><span class="line"></span><br><span class="line">Markdown 标题：</span><br><span class="line"><span class="comment"># 这是 H1</span></span><br><span class="line"><span class="comment">## 这是 H2</span></span><br><span class="line"><span class="comment">### 这是 H3</span></span><br><span class="line"></span><br><span class="line">Markdown 列表：</span><br><span class="line">- 列表项目</span><br><span class="line"><span class="number">1.</span> 列表项目</span><br><span class="line"></span><br><span class="line">*斜体*或_斜体_</span><br><span class="line">**粗体**</span><br><span class="line">***加粗斜体***</span><br><span class="line">~~删除线~~</span><br><span class="line"></span><br><span class="line">Markdown 插入链接：</span><br><span class="line">[链接文字](链接网址 <span class="string">&quot;标题&quot;</span>)</span><br><span class="line"></span><br><span class="line">Markdown 插入图片：</span><br><span class="line">![alt text](/path/to/img.jpg <span class="string">&quot;Title&quot;</span>)</span><br><span class="line"></span><br><span class="line">Markdown 插入代码块：</span><br><span class="line">    ```python</span><br><span class="line">    <span class="comment">#!/usr/bin/python3</span></span><br><span class="line">    print(<span class="string">&quot;Hello, World!&quot;</span>);</span><br></pre></td></tr></table></figure>

<p>Markdown 引用：</p>
<blockquote>
<p>引用内容</p>
</blockquote>
<h2 id="Markdown-分割线："><a href="#Markdown-分割线：" class="headerlink" title="Markdown 分割线："></a>Markdown 分割线：</h2><p>Markdown 换行：<br><br></p>
<p>Markdown 段首缩进：<br>&ensp; or &#8194; 表示一个半角的空格<br>&emsp; or &#8195;  表示一个全角的空格<br>&emsp;&emsp; 两个全角的空格（用的比较多）<br>&nbsp; or &#160; 不断行的空白格</p>
<pre><code></code></pre>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  


  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/6/"><i class="fa fa-angle-left" aria-label="Previous page"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/6/">6</a><span class="page-number current">7</span>
  </nav>



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">Hory Skone</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">67</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">30</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">35</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/horysk" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;horysk" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:admin@horysk.com" title="E-Mail → mailto:admin@horysk.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="http://www.hory-ai.com/" title="HoryAI → http:&#x2F;&#x2F;www.hory-ai.com" rel="noopener" target="_blank"><i class="fab fa-google fa-fw"></i>HoryAI</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://blog.csdn.net/sirobot" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;sirobot" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>CSDN</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.zhihu.com/people/AI_HH" title="ZhiHu → https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;AI_HH" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>ZhiHu</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.kaggle.com/" title="Kaggle → https:&#x2F;&#x2F;www.kaggle.com&#x2F;" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>Kaggle</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://tianchi.aliyun.com/competition/gameList/activeList" title="TianChi → https:&#x2F;&#x2F;tianchi.aliyun.com&#x2F;competition&#x2F;gameList&#x2F;activeList" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>TianChi</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://works.yangerxiao.com/honeyed-words-generator" title="土情话 → https:&#x2F;&#x2F;works.yangerxiao.com&#x2F;honeyed-words-generator" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>土情话</a>
      </span>
  </div>



      </div>

      
      <script type="text/javascript" charset="utf-8" src="/js/tagcloud.js"></script>
      <script type="text/javascript" charset="utf-8" src="/js/tagcanvas.js"></script>
      <div class="widget-wrap">
          <h3 class="widget-title">Tag Cloud</h3>
          <div id="myCanvasContainer" class="widget tagcloud">
              <canvas width="250" height="250" id="resCanvas" style="width:100%">
                  <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/AI/" rel="tag">AI</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/BI/" rel="tag">BI</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Centos/" rel="tag">Centos</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/DNS/" rel="tag">DNS</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Dapp/" rel="tag">Dapp</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Docker/" rel="tag">Docker</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Hack/" rel="tag">Hack</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Hexo/" rel="tag">Hexo</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/HyperLedger-Fabric/" rel="tag">HyperLedger Fabric</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Hyperledger-Fabric/" rel="tag">Hyperledger Fabric</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Iftop/" rel="tag">Iftop</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Linux/" rel="tag">Linux</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ML/" rel="tag">ML</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/MTProxy/" rel="tag">MTProxy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Mongo/" rel="tag">Mongo</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Network/" rel="tag">Network</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Pyppeteer/" rel="tag">Pyppeteer</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Tools/" rel="tag">Tools</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/VPN/" rel="tag">VPN</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Vnc/" rel="tag">Vnc</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/baostock/" rel="tag">baostock</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/block-chain/" rel="tag">block chain</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/centos-xfce-vnc/" rel="tag">centos-xfce-vnc</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/" rel="tag">docker</a><span class="tag-list-count">11</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/fabric/" rel="tag">fabric</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/" rel="tag">hexo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/horysk/" rel="tag">horysk</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/k8s/" rel="tag">k8s</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/" rel="tag">linux</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mongo/" rel="tag">mongo</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pyppeteer/" rel="tag">pyppeteer</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/" rel="tag">python</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/quant/" rel="tag">quant</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/stock/" rel="tag">stock</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/tushare/" rel="tag">tushare</a><span class="tag-list-count">1</span></li></ul>
              </canvas>
          </div>
      </div>
      
    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        
  <div class="beian"><a href="http://www.beian.miit.gov.cn/" rel="noopener" target="_blank">null </a>
  </div>

<div class="copyright">
  
  &copy; 2015 – 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hory Skone</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="Symbols count total">275k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="Reading time total">4:10</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  
  <script color='255,255,255' opacity='0.6' zIndex='-1' count='99' src="/lib/canvas-nest/canvas-nest.min.js"></script>
  <script size="300" alpha="0.6" zIndex="-1" src="/lib/canvas-ribbon/canvas-ribbon.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>


  <script defer src="/lib/three/three.min.js"></script>
    <script defer src="/lib/three/three-waves.min.js"></script>
    <script defer src="/lib/three/canvas_lines.min.js"></script>
    <script defer src="/lib/three/canvas_sphere.min.js"></script>


  
  <script>
    (function(){
      var canonicalURL, curProtocol;
      //Get the <link> tag
      var x=document.getElementsByTagName("link");
		//Find the last canonical URL
		if(x.length > 0){
			for (i=0;i<x.length;i++){
				if(x[i].rel.toLowerCase() == 'canonical' && x[i].href){
					canonicalURL=x[i].href;
				}
			}
		}
    //Get protocol
	    if (!canonicalURL){
	    	curProtocol = window.location.protocol.split(':')[0];
	    }
	    else{
	    	curProtocol = canonicalURL.split(':')[0];
	    }
      //Get current URL if the canonical URL does not exist
	    if (!canonicalURL) canonicalURL = window.location.href;
	    //Assign script content. Replace current URL with the canonical URL
      !function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=canonicalURL,t=document.referrer;if(!e.test(r)){var n=(String(curProtocol).toLowerCase() === 'https')?"https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif":"//api.share.baidu.com/s.gif";t?(n+="?r="+encodeURIComponent(document.referrer),r&&(n+="&l="+r)):r&&(n+="?l="+r);var i=new Image;i.src=n}}(window);})();
  </script>




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('https://cdn.jsdelivr.net/npm/valine@1.3.9/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : '2ASH47v4VIRijd91HeEi3pws-gzGzoHsz',
      appKey     : 'ojRfR89cSV614pgJFT36lFFB',
      placeholder: "昵称填写qq可以显示qq头像和昵称哦~",
      avatar     : 'monsterid',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : '' || 'zh-cn',
      path       : location.pathname,
      recordIP   : true,
      serverURLs : '',
      requiredFields: ['nick','mail'] 
    });
  }, window.Valine);
});
</script>

  <!-- 页面点击特效 -->
  <script type="text/javascript" src="/js/jquery-3.3.1.min.js"></script>
  <script type="text/javascript" src="/js/click-word.js"></script>
  
  <script type="text/javascript"
  color="255,255,255" opacity='0.7' zIndex="-2" count="500" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
  
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"log":false,"model":{"jsonPath":"/live2dw/assets/z16.model.json"},"display":{"position":"right","width":300,"height":600},"mobile":{"show":true}});</script></body>
</html>
